<template>
  <div class="person">
    <h2>当前求和值为：{{ sum }}  大和为: {{ bigSum }}</h2>
    <button @click="increase">加1</button>
    <button @click="decrease">减1</button>
    <hr>
    <img v-for="(u,index) in dogList" :key="index" :src="(u as string)"> 
    <button @click="getDog">再来一只狗</button>
  </div>
</template>

<!-- <script lang="ts"> -->
  <!-- // export default {
    // name: 'Person',
    // setup() {
    //   // 数据
    //   let name= 'zhang san'
    //   let age = '18'
    //   let tel = '121212121'


    //   // 方法
    //   const changeName = () => {
    //     name = 'wang wang'
    //   }
    //   const changeAge = () => {
    //     age = '20'
    //   }
    //   const showTel = () => {
    //     alert(tel)
    //   }
    //   return {
    //     name, age, tel, changeName, changeAge, showTel
    //   }
    // }
  // }
// </script> -->
<script lang="ts" setup name="Person">
  import useSum from '@/hooks/useSum'
  import useDog from '@/hooks/useDog'

  const { sum, bigSum, increase, decrease } = useSum()
  const { dogList, getDog } = useDog()
  
</script>

<style lang="scss" scoped>

</style>